using System;
using System.Collections.Generic;

namespace DatastoreLib {
	public class StorageImplementation : StorageFacade {
		
		ElevatorLogging el;
		
		public StorageImplementation () {
            el = new ElevatorLogging();
        }

        #region StorageFacade Members

        public void StoreArrivedAt(int floor) {
			el.addEntry("arrived at", floor.ToString());
		}
		
		public void StoreMovingTo(int floor) {
			el.addEntry("moving to", floor.ToString());
		}

        public void StoreNewEmergency()
        {
            el.addEntry("emergency break", "no info");
        }

        public List<LoggingEntry> GetLog(string type, int amount)
        {
            return el.retrieveEntries(type, amount);
        }

        public List<LoggingEntry> GetLog(string type)
        {
            return el.retrieveEntries(type);
        }

        public void StoreGoTo(int floor)
        {
            el.addEntry("go to", floor.ToString());
        }

        public void StoreCallEmergency()
        {
            el.addEntry("emergency break", "called by administrator"); 
        }

        public void StoreResumeOperations()
        {
            el.addEntry("resume operations", "called by administrator");
        }

        #endregion
    }
}

